home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 8 / Amoszine 8 (Disk 2 of 3).adf / Powerbobs.lha / powerbobsv1.0 / demos / PowerBobs_test.Asc < prev    next >
Text File  |  1995-06-30  |  3KB  |  121 lines

  1. ' Program: Count number of bobs before frame rate drops from 50fps.  
  2. ' Author : Paul Overy  
  3. '
  4. ' *** TRUE RESULTS ONLY WITH AMOS CLASSIC ***
  5. ' *** ONLY CLASSIC CAN FULLY LOCK OUT THE ***
  6. ' *** MULTITAKING SYSTEM.                 ***
  7. '
  8. ' This program was written to test Powerbobs against Amos bobs.  
  9. '  
  10. ' I've kept this test fair by not using any Powerbob array arithmetic
  11. ' commands.  So it's just bob's against Pbob's.  
  12. '  
  13. '  
  14. Paper 0 : Cls 0
  15. Repeat : Input "What bob size to test (16 or 32)?";SIZE : Until SIZE=32 or SIZE=16
  16. Repeat : Input "How many Bit Planes (1 to 5)?";C : Until C>0 and C<6
  17. Screen Open 0,320,256,2^C,Lowres : Screen Hide 0
  18. Flash Off : Curs Off : Paper 0 : Pen 1
  19. '
  20. '-- Cut out all bobs 
  21. '
  22. N=1
  23. For L=1 To SIZE
  24.    Ink 0 : Bar 0,0 To SIZE,SIZE : Ink 1 : Bar 0,0 To L,L
  25.    Get Bob N,0,0 To SIZE,SIZE : Inc N
  26. Next L
  27. For L=SIZE To 1 Step -1
  28.    Ink 0 : Bar 0,0 To SIZE,SIZE : Ink 1 : Bar 0,0 To L,L
  29.    Get Bob N,0,0 To SIZE,SIZE : Inc N
  30. Next L
  31. '
  32. NULL=Execall(-132) : Rem -- Multitasking off
  33. '
  34. Cls 0
  35. Centre Cdown$+Border$("TESTING AMOSBOBS, PLEASE WAIT...",1)
  36. Double Buffer : Autoback 0 : Bob Update Off 
  37. Screen Show 0
  38. '
  39. '-- Fisrt test, for Amos.
  40. '
  41. AMOSBOBS_TOTAL=1 : Timer=0 : COUNT_FRAMES=1
  42. '
  43. Do 
  44.    Add _ANIM,1,1 To SIZE*2
  45.    W=0
  46.    For K=1 To AMOSBOBS_TOTAL
  47.       Bob K,X+W,((K-1)/5)*18,_ANIM
  48.       Add W,18,0 To 72
  49.    Next K
  50.    Add X,1,0 To 320
  51.    Bob Clear : Bob Draw 
  52.    Screen Swap 
  53.    Wait Vbl 
  54.    Inc COUNT_FRAMES : T=Timer
  55.    If COUNT_FRAMES=50
  56.       Exit If T>50
  57.       Inc AMOSBOBS_TOTAL
  58.       COUNT_FRAMES=1
  59.       Exit If POWERBOBS_TOTAL>64
  60.       Timer=1
  61.    End If 
  62. Loop 
  63. '
  64. Cls 0
  65. Centre Cdown$+Border$("TESTING POWERBOBS, PLEASE WAIT...",1)
  66. Screen Swap 
  67. Screen Copy Physic To Logic
  68. '
  69. '-- Define pbob types. 
  70. '
  71. Make Mask : Reserve Pbobs 64 : Pbob Dbuf True
  72. For K=1 To 64
  73.    Pbob Height K,SIZE
  74. Next K
  75. '
  76. '-- 2nd test, for Powerbobs. 
  77. '
  78. POWERBOBS_TOTAL=1 : Timer=0 : COUNT_FRAMES=1
  79. '
  80. Do 
  81.    Add _ANIM,1,1 To SIZE*2
  82.    W=0
  83.    For K=1 To POWERBOBS_TOTAL
  84.       Pbob K,X+W,((K-1)/5)*18,_ANIM
  85.       Add W,18,0 To 72
  86.    Next K
  87.    Add X,1,0 To 320
  88.    Pbob Clear 1 To POWERBOBS_TOTAL
  89.    Pbob Draw 1 To POWERBOBS_TOTAL
  90.    Screen Swap 
  91.    Wait Vbl 
  92.    Inc COUNT_FRAMES : T=Timer
  93.    If COUNT_FRAMES=50
  94.       Exit If T>50
  95.       Inc POWERBOBS_TOTAL
  96.       COUNT_FRAMES=1
  97.       Exit If POWERBOBS_TOTAL>64
  98.       Timer=1
  99.    End If 
  100. Loop 
  101. '
  102. NULL=Execall(-138) : Rem -- Multitaking on
  103. '
  104. '-- Report on both speed tests.
  105. '
  106. Cls 0 : Home 
  107. Centre Cdown$+Border$("TEST RESULTS",1)
  108. Print At(0,4)+"Total number of Bobs updated"
  109. Print "before frame rate dropped from 50fps"
  110. Print 
  111. Print "On a";2^C;" Colour screen:-"
  112. Print 
  113. Print "     Normal Amos =";AMOSBOBS_TOTAL-1
  114. Print "     PowerBobs   =";POWERBOBS_TOTAL-1
  115. Print "                   --"
  116. Print "                  ";POWERBOBS_TOTAL-AMOSBOBS_TOTAL;" Extra bob(s)"
  117. Print "                   --"
  118. Print Cdown$+Cdown$+"Any key to exit"
  119. Screen Swap 
  120. Wait Key 
  121.